import { BasicColumn, FormSchema } from '/@/components/Table';

export const useRoleUpdateSchemaForm = (): FormSchema[] => {
  return [
    { field: 'roleName', label: '角色名称', component: 'Input' },
    { field: 'roleKey', label: '角色权限', component: 'Input' },
    { field: 'roleSort', label: '', component: 'Input' },
    { field: 'remark', label: '备注', component: 'Input' },
    { field: 'dataScope', label: '数据范围', component: 'Input' },
    { field: 'status', label: '角色状态', component: 'Input' },
    { field: 'menuIds', label: '菜单ID', component: 'Input' },
    { field: 'roleId', label: '角色ID', component: 'Input' },
  ];
};

export const useRoleAddSchemaForm = (): FormSchema[] => {
  return [
    { field: 'roleName', label: '角色名称', component: 'Input' },
    { field: 'roleKey', label: '角色权限', component: 'Input' },
    { field: 'roleSort', label: '', component: 'Input' },
    { field: 'remark', label: '备注', component: 'Input' },
    { field: 'dataScope', label: '数据范围', component: 'Input' },
    { field: 'status', label: '角色状态', component: 'Input' },
    { field: 'menuIds', label: '菜单ID', component: 'Input' },
  ];
};

export const useRoleListColumns = (): BasicColumn[] => {
  return [
    { title: '角色ID', dataIndex: 'roleId' },
    { title: '角色名称', dataIndex: 'roleName' },
    { title: '角色标识', dataIndex: 'roleKey' },
    { title: '角色排序', dataIndex: 'roleSort' },
    { title: '角色状态', dataIndex: 'status' },
    { title: '备注', dataIndex: 'remark' },
    { title: '创建时间', dataIndex: 'createTime' },
    { title: '数据范围', dataIndex: 'dataScope' },
  ];
};

export const useRoleListSearchForm = (): FormSchema[] => {
  return [
    { field: 'roleName', label: '角色名称', component: 'Input' },
    { field: 'roleKey', label: '角色标识', component: 'Input' },
    { field: 'status', label: '角色状态', component: 'Input' },
  ];
};
